<template>
      <div class="interval">
        <div id="homework">

          <template>
           
          </template>
            <ul class="list-group">
                <li class="list-group-item disabled" aria-current="true" style="background:rgb(247,247,247);color: black;"> {{currentHeadName}}</li>
                <li class="list-group-item mousecolor" v-for="item in list" @click="clickHomework($event)">
                     <span class="wrap" ><img :src="imgurl"/><span>&nbsp;<text>第{{item}}次{{currentName}}</text><br>&nbsp;{{tijiao}}</span></span>
                </li>
            </ul>
           
        </div>
      </div>
</template>
  
  <script>
 
  export default
  {
    data () 
    {
      return {list:[1,2,3,4,5,6,7,8,9,10,11,12,13,14],
      index:0
      };
    },
    props:['currentName','isSubmitted'],
    components: {},
    computed: {
      tijiao()
      {
        let option=0
        if(option==0)
        return "未提交";
        else
        return "已提交";
      },
      imgurl()
      {
        let option=0
        if(option==0)
        return require("@/assets/img/start.png");
        else
        return require("@/assets/img/end.png")
      },
      currentHeadName()
      {
         //option 0未提交 1已提交 2全部 3已提交但不允许查看
         //type 
        let name="未截止";

        if(this.isSubmitted==1)
        {
          name="已提交";
        }
        else if(this.isSubmitted==2)
        {
          name="";
        }
        return name+this.currentName;
      }
    },
  
    methods: {
      clickHomework(event)
      {
        var temp=event.currentTarget;
        temp=temp.firstElementChild.lastElementChild.firstElementChild;
        let text=temp.innerText;
        if(this.currentName=="考试")
        this.$router.push(`/MyExam/${this.currentName}/${text}`);
        else
       // window.open(`/HomeworkDetail/${this.currentName}/${text}`, '_blank');
        this.$router.push(`/HomeworkDetail/${this.currentName}/${text}`);
        // console.log(text);
      }
    }
  }
  
  </script>
  
  <style  scoped>
  .mousecolor:hover
  {
    background-color:rgb(247,250,252);
    
  }
  .wrap {
  /* 可无需设置高度，靠图片高度 或者 文字的上下padding撑开高度 */
    margin: 0px;
    padding: 0px;
  }
  .wrap span{
      display: inline-block;
      vertical-align: middle;
      padding: 20px 0; /* 撑开高度 */
  }
  .wrap img{
      width: 55px;
      height: auto;
      vertical-align: middle;
  }
  .tupain{
      float: left;
      height:30px;
      width: auto;
  }
   .blackCharactersOnWhitePaper{
      background:rgb(255,255,255);color: black;
   }
   .interval{
      background-color: rgb(247,247,247);
      padding: 0px;
      position: absolute;
      top:50px;
      left: 230px;
      right: 0px;
      
      height: auto;
   }
   #homework{
      background-color: rgb(255,255,255);
      position:  absolute;
      top:30px;
      left:30px;
      right:30px;
      bottom:0px;
      width: auto;
      height: auto;
   }
  </style>